<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.biz.utils.ConfigUtil" %>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
    String resoursUrl = ConfigUtil.get("RESOURCES_URL");
%>

<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>体验店服务费记录</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="<%=resoursUrl%>resources/assets/css/jifen1.css" />
	<script src="<%=resoursUrl%>resources/assets/js/flexible_css.debug.js"></script>
	<script src="<%=resoursUrl%>resources/assets/js/flexible.debug.js"></script>
  <jsp:include page="/jsp/inc_head.jsp"></jsp:include>

<style>
	.am-text-xs{
		font-size:0.3rem;
	}
	/*.Tab_on{
		background-color:#ff4c00;
	}/*橙色*/
		.Tab_on{
            background-color:#3f4a9a;
        }/*蓝色*/
</style>
</head>
<body>
<div class="JF_out">
	<div class="Tab X_tab Tab_on"><div class="X_ico"></div>已消费<p class="SanJiao"></p></div>
	<div class="Tab T_tab"><div class="T_ico"></div>已退款<p class="SanJiao"></p></div>
	<table class="L_table XF" id="yxf">
		<tr>
			<th colspan="3">
				<div>订单总数：<span id="djzs">0</span></div>
			<%--	<div>消费合计：<span id="xfhj">0.00</span></div>--%>
			</th>
		</tr>
		<tr>
			<td class="first">时间</td>
			<td class="second">金额</td>
			<td class="third">扫码方式</td>
		</tr>
	</table>
	<table class="L_table TK" id="ytk">
		<tr>
			<th colspan="3">
				<div>退单总数：<span id="tdzs">0</span></div>
				<%--<div>退款合计：<span tkhj>0.00</span></div>--%>
			</th>
		</tr>
		<tr>
			<td class="first">时间</td>
			<td class="second">金额</td>
			<td class="third">扫码方式</td>
		</tr>
	</table>
</div>
<!--footer-->
<jsp:include page="/jsp/inc_bottom.jsp"></jsp:include>
<!--footer-->
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
	<div class="am-modal-dialog">
		<div class="am-modal-hd" id="alert_title">哎呦喂，出错啦</div>
		<div class="am-modal-bd" id="alert_message"></div>
		<div class="am-modal-footer">
			  <span class="am-modal-btn">确定</span>
		</div>
	</div>
</div>
<script>

	var pageIn=1;
	var pageOut=1;
	$(function () {
		loadDetailIn (1)
		loadDetailOut (1)
	});
	$(document).ready(function(){
		$(".Tab").click(function(){
			var Index=$(this).index();
			$(".Tab").removeClass("Tab_on");
			$(this).addClass("Tab_on");
			$(".L_table").hide().eq(Index).show();
		});
	});
	function loadDetailIn (page) {
		//查询消费记录
		var url=ajaxpath+"/userCenter/getTYDRecord90.do?page="+page+"&type=1";
		$.get(url,function(data){
			if(data.return_data!=null&&data.return_data!=undefined&&data.length>0)
			{
				var html='';
				for(var i=0;i<data.length;i++)
				{
					var money = parseFloat(data.orderList[i].cash_total);
					money = (money / 100).toFixed(2);
					html+='<tr>';
					html+='<td>'+data.orderList[i].create_time+'</td>';
					html+='<td class="B">'+money+'</td>';
					var orderType='';
					if(data.orderList[i].trade_type=='NATIVE'||data.orderList[i].trade_type=='JSAPI')
					{
						orderType='微信主扫';
					}
					else  if(data.orderList[i].trade_type=='MICROPAY')
					{
						orderType='微信被扫';
					}
					else  if(data.orderList[i].trade_type=='OFFLINE')
					{
						orderType='现金支付';
					}
					else  if(data.orderList[i].trade_type=='RECHARGE')
					{
						orderType='储值卡主扫';
					}
					else  if(data.orderList[i].trade_type=='RECHARGE_SCAN')
					{
						orderType='储值卡被扫';
					}
					else  if(data.orderList[i].trade_type=='UNIONPAY')
					{
						orderType='银行卡支付';
					}
					else  if(data.orderList[i].trade_type=='ZFB-MICROPAY')
					{
						orderType='支付宝被扫';
					}
					else  if(data.orderList[i].trade_type=='ZFB-NATIVE'||data.orderList[i].trade_type=='ZFB-ZFB-JSAPI')
					{
						orderType='支付宝主扫';
					}
					else  if(data.orderList[i].trade_type=='YZF-MICROPAY')
					{
						orderType='翼支付被扫';
					}
					else
						{orderType='未知';}
					html+='<td class="right">'+orderType+'</td>';
					html+='</tr>';
				}
				$("#yxf").append(html);
				$("#djzs").append(data.size);
			}
		});
	}
	function loadDetailOut (page) {
		//查询退款记录
		var url=ajaxpath+"/userCenter/getTYDRecord90.do?page="+page+"&type=3";
		$.get(url,function(data){
			if(data.return_data!=null&&data.return_data!=undefined&&data.length>0)
			{var html='';
				for(var i=0;i<data.length;i++)
				{

					var money = parseFloat(data.orderList[i].cash_total);
					money = (money / 100).toFixed(2);
					html+='<tr>';
					html+='<td>'+data.orderList[i].create_time+'</td>';
					html+='<td class="B">'+money+'</td>';
					var orderType='';
					if(data.orderList[i].trade_type=='NATIVE'||data.orderList[i].trade_type=='JSAPI')
					{
						orderType='微信主扫';
					}
					else  if(data.orderList[i].trade_type=='MICROPAY')
					{
						orderType='微信被扫';
					}
					else  if(data.orderList[i].trade_type=='OFFLINE')
					{
						orderType='现金支付';
					}
					else  if(data.orderList[i].trade_type=='RECHARGE')
					{
						orderType='储值卡主扫';
					}
					else  if(data.orderList[i].trade_type=='RECHARGE_SCAN')
					{
						orderType='储值卡被扫';
					}
					else  if(data.orderList[i].trade_type=='UNIONPAY')
					{
						orderType='银行卡支付';
					}
					else  if(data.orderList[i].trade_type=='ZFB-MICROPAY')
					{
						orderType='支付宝被扫';
					}
					else  if(data.orderList[i].trade_type=='ZFB-NATIVE'||data.orderList[i].trade_type=='ZFB-ZFB-JSAPI')
					{
						orderType='支付宝主扫';
					}
					else  if(data.orderList[i].trade_type=='YZF-MICROPAY')
					{
						orderType='翼支付被扫';
					}
					else
					{orderType='未知';}
					html+='<td class="right">'+orderType+'</td>';
					html+='</tr>';
				}
				$("#ytk").append(html);
				$("#tdzs").append(data.size);
			}
		});
	}



	/*****加载信息--------开始****************/
	/** 下拉时调用 再次加载*/
	$(window).scroll(function()
	{

		if (($(window).scrollTop() + $(window).height() >= $(document).height()- 50)
		)
		{
			pageIn++;
			pageOut++;
			loadDetailIn(pageIn);
			loadDetailOut(pageOut);
		}
	});
</script>
</body>
</html>
